package com.xmtlxx.wms.mapper;

import com.xmtlxx.common.annotation.DataColumn;
import com.xmtlxx.common.annotation.DataPermission;
import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import com.xmtlxx.wms.domain.WarehouseDtl;
import com.xmtlxx.wms.domain.bo.WarehouseDtlBo;
import com.xmtlxx.wms.domain.vo.WarehouseDtlVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 入库明细Mapper接口
 *
 * @author xmtlxx
 * @date 2022-08-15
 */
public interface WarehouseDtlMapper extends BaseMapperPlus<WarehouseDtlMapper, WarehouseDtl, WarehouseDtlVo> {
    /**
     * 根据条件分页查询入库明细
     *
     * @param warehouseDtl 入库明细
     * @return Page WarehouseDtl
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "wa.create_by"),
        @DataColumn(key = "deptName", value = "s.dept_id"),
        @DataColumn(key = "userName", value = "wa.create_by")
    })
    Page<WarehouseDtlVo> selectPageWarehouseDtlList(@Param("page") Page<WarehouseDtl> page,@Param("warehouseDtl") WarehouseDtlBo warehouseDtl);

    /**
     * 查询入库明细列表
     *
     * @param warehouseDtl 入库明细
     * @return 入库明细集合
     */
//    @DataPermission({
//        @DataColumn(key = "tenantName", value = "wa.create_by"),
//        @DataColumn(key = "deptName", value = "s.dept_id"),
//        @DataColumn(key = "userName", value = "wa.create_by")
//    })
    List<WarehouseDtlVo> selectWarehouseDtlList(@Param("warehouseDtl") WarehouseDtlBo warehouseDtl);

    WarehouseDtlVo selectWarehouseDtlVoByID(String id);

    Boolean deleteVoById(String id);

    List<WarehouseDtl> selectWarehouseDtl(@Param("warehouseDtl") WarehouseDtlBo warehouseDtl);

    int updateWarehouseDtl(@Param("warehouseDtl") WarehouseDtl warehouseDtl);

    int updateWarehouseDtlBatchById(@Param("list") List<WarehouseDtl> warehouseDtls);

    void removeWarehouseDtlBatch(@Param("list") List<WarehouseDtl> warehouseDtls);
}
